<?php

class Webservice_Model_LogicHelper {

    public function buildDataJSON($arrayData) {
        header('Content-type: application/json; charset=UTF-8');
        echo (Zend_Json_Encoder::encode($arrayData));
    }
    public function buildDataXml($arrayData) {
//        $options = array(
//            'location' => 'http://' . $_SERVER['HTTP_HOST'] . '/shopws/index.php/webservice/index/soap',
//            'uri' => 'http://' . $_SERVER['HTTP_HOST'] . '/shopws/index.php/webservice/index/soap',
//            'encoding' => 'UTF-8'
//        );
        //        header('Content-type: text/xml');
        //        echo '<products>';
//        foreach ($aryProducts as $index => $product) {
//            if (is_array($product)) {
//                foreach ($product as $key => $value) {
//                    echo '<',$key,'>';
//                    if (is_array($value)) {
//                        foreach ($value as $tag => $val) {
//                            echo '<',$tag,'>',htmlentities($val),'</',$tag,'>';
//                        }
//                    } else {
//                        echo htmlentities($value);
//                    }
//                    echo '</',$key,'>';
//                }
//            }
//        }
//        echo '</products>';
    }

}